import json  # 导入json包
import os

# 打开文件
file = open(r'data.json', 'r', encoding='utf8')
# 打开json文件进行读取
j1 = json.load(file)  # 返回的类型是一个字典
print(j1)
print(type(j1))
# 关闭
file.close()
for a in j1:  # 对字典进行遍历
    print(a, j1[a])

with open(r'data.json', 'r', encoding='utf8') as f1:
    json.load(f1)
